<?php
    include('./config.php');
    include('./request.php');
    $goods_id = $result->goodsid;
    $goods_name = $result->goodsname;
    $goods_price = $result->goodsprice;
    $goods_num = $result->goodsnum;
    $goods_type = $result->goodstype;
    try{
        $pdo = new PDO($dsn,$user,$pass);
        $sql = "update goods set goods_name='".$goods_name."',goods_price=".$goods_price.",goods_num=".$goods_num.",goods_type='".$goods_type."' where goods_id=".$goods_id;
        $res = $pdo->prepare($sql);
        $res->execute();
        if($res){
            echo "ok";
        }else{
            echo "error";
        }
    }catch(PDOException $e){
        echo "error1";
    }
?>